<template>
  <!-- 《服务条款》与《隐私政策》 -->
  <div class="terms-container">
    <div class="r-header">
      <div class="content">
        <nuxt-link to="/" tag="a" class="logo">
          <!-- <span class="img"></span> -->
          <!-- <img src="/assets/images/register-logo.png" /> -->
          <span class="img" style="background: none;font-size: 22px;font-weight: bold;margin-top: 10px;">{{$t('companyName')}}</span>
        </nuxt-link>
        <div class="go-login">
          <nuxt-link to="/login" class="login-btn">{{$t('register.goToLogin')}}</nuxt-link>
        </div>
      </div>
    </div>
    <div class="terms-box">
      <div v-html="content"></div>
    </div>
  </div>
</template>

<script>
export default {
  layout: 'policy',
  data () {
    return {
      showFirstTerma: true,
      sts: this.$route.query.sts,
      lang: this.$t('language') == 'zh'?0:1 ,//0 中文 1 英语,
      content: ''
    }
  },
  methods: {

  },
  created () {
    // key = 'service-terms'代表服务条款，key = 'service-policy'代表隐私策略
    if (this.sts == 0) {
      this.$axios.get('/sys/config/info/serviceTerms')
      .then(({ data }) => {
        this.content = data.content
      })
    } else if (this.sts == 1) {
      this.$axios.get('/sys/config/info/servicePolicy')
      .then(({ data }) => {
        this.content = data.content
      })
    }
  },
  mounted () {
    this.$emit('hideLoginPop')
  },
  methods: {
    privacyPolicy: function () {
      this.showFirstTerma = false
    },
    servicePolicy: function () {
      this.showFirstTerma = true
    },
  }
}
</script>

<style scoped>
.terms-box {
  width: 60%;
  margin: 30px auto;
  font-size: 15px;
}
.article-tit {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}
.cont,
.cont-tit {
  margin: 15px 0;
  text-align: justify;
  line-height: 1.6em;
}
.cont {
  text-indent: 2em;
}
.blod {
  font-weight: bold;
}
.signature {
  text-align: right;
  margin-top: 50px;
}
.jump {
  color: #1588ca;
  text-decoration: underline;
}
</style>
